package com.ftg.learn.service;

import com.ftg.learn.mapper.PingceMapper;
import com.ftg.learn.pojo.Pingce;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PingceService {
    @Autowired
    PingceMapper pingceMapper;
    //查询加分页
    public List<Pingce> showall(int page,int limit){
        int begin = (page - 1)*limit;
        return pingceMapper.showall(begin,limit);
    }
    //查一
    public List<Pingce> findone(String pingce_id,String pingce_bt){
        return pingceMapper.findone(pingce_id,pingce_bt);
    }
    // 共多少条
    public int getcount(){
        return pingceMapper.getcount();
    }
    //添加
    public int add(Pingce pingce){
        return pingceMapper.add(pingce);
    }
    //删除
    public int delete(String pingce_id){
        return pingceMapper.delete(pingce_id);
    }
    //修改
    public int update(Pingce pingce){
        return pingceMapper.update(pingce);
    }
}
